<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .top {
        border-bottom: 1px solid #000;
        display: flex;
      }
      .tab {
        width: 80px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-left: 1px solid #000;
        border-top: 1px solid #000;
        cursor: pointer;
      }
      .tab:last-child {
        border-right: 1px solid #000;
      }
      .active {
        color: skyblue;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="top">
        <div
          class="tab"
          v-for="(item, index) in topList"
          :key="item"
          :class="{active: active === index}"
          @click="active = index"
        >
          {{ item }}
        </div>
      </div>
      <div>{{ contentList[active] }}</div>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      Vue.createApp({
        data() {
          return {
            topList: ["User", "Config", "Role", "Task"],
            active: 0,
            contentList: ["User11", "Config22", "Role33", "Task44"],
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
